//
//  RBGCreditsController.m
//  BateauGenerique
//
//  Created by Kevin De Jesus Ferreira on 20/05/2014.
//  Copyright (c) 2014 Kevin De Jesus Ferreira. All rights reserved.
//

#import "RBGCreditsController.h"
#import "RBGNavigationBar.h"
#import "RBGColorManager.h"
#import "RBGAppDelegate.h"
#import "UIImageView+WebCache.h"
#import "Constantes.h"

@interface RBGCreditsController (){
    RBGAppDelegate *appDelegate;
}

@end

@implementation RBGCreditsController


- (void)viewDidLoad
{
    [super viewDidLoad];
    [self charger];
    [self remplir];
    [self positionnerVue];
    [self chargerCouleur];
}

-(void) charger
{
    appDelegate = (RBGAppDelegate *)[[UIApplication sharedApplication] delegate];
    
}

-(void) remplir
{
    [self setTitle:@"Credits"];
    [RBGNavigationBar customNavigationBar:self.navigationController andTitle:@"Autres" andBackgroundColor:appDelegate.donnees.parametres.backgroundColorUn andTextColor:appDelegate.donnees.parametres.fontColorUn];
    
    self.descriptionCredits.backgroundColor = [UIColor clearColor];
    
    [self.imageCredits setImageWithURL:[NSURL URLWithString:appDelegate.donnees.parametres.imageLogo]];
    [self.fond setImageWithURL:[NSURL URLWithString:appDelegate.donnees.parametres.imageFond]];
    
    //TODO CHANGER AVEC LES DONNEES CLIENTS QUI SERONT CHARGER DANS LE SPLASH
    [self.nomProprietaire setText:NOM_APPLICATION];

    
}

-(void) positionnerVue
{
    
    [self.imageCredits setFrame:CGRectMake(120, 10, 100, 80)];
    [self.descriptionCredits setFrame:CGRectMake(10, self.imageCredits.frame.origin.y + self.imageCredits.frame.size.height + 30, self.descriptionCredits.frame.size.width, self.descriptionCredits.frame.size.height)];
}


-(void) chargerCouleur
{
    [RBGColorManager changeTextColorSubViews:self.descriptionCredits withColor:appDelegate.donnees.parametres.fontColorDeux];
    
}

@end
